<h2>Gestion des administrateurs</h2>

<div class="button-box">
	<?= button_link('admin/config/admin_new', 'Nouvel administrateur', 'add') ?>
</div>
<table class="dataTable display">
	<thead>
		<tr>
			<th>E-mail</th>
			<th>Prénom</th>
			<th>Nom</th>
			<th>Créé le</th>
			<th>Actions</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach ($users as $user) { ?>
			<tr id="user_<?= $user->id ?>">
				<td><?= $user->email ?></td>
				<td><?= $user->firstname ?></td>
				<td><?= $user->name ?></td>
				<td><?= time_to_str($user->created_at) ?></td>
				<td class="actions">
					<?= details_link($user, 'user_details') ?>
					<?php if ($user->id == $this->session->userdata('user_id')) {
						echo edit_link($user, 'config/my_profile');
					}
					else {
						echo delete_link($user, 'user_delete');
					} ?>
				</td>
			</tr>
		<?php } ?>
	</tbody>
</table>

